<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ include file="base.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link href="styles/style.css" rel="stylesheet" type="text/css" />
<title>登录页</title>
<script type="text/javascript" src="script/jquery.js"></script>
<script type="text/javascript">
	$(document).ready(function(){
		$("form :input.required").each(function(){
			 var $required = $('<strong class="high">*</strong>');
			$(this).parent().append($required);
		});
		$("form :input").blur(function(){
			var $parent = $(this).parent();
			$parent.find(".formtips").remove();
			//验证用户名
			if($(this).is("#title")){
				if(this.value == ""){
					var errorMsg = '标题不能为空';
					$parent.append('<span class = "formtips onError">'+errorMsg+'</span>');
				}else{
					var okMsg = '输入正确';
					$parent.append('<span class = "formtips onRight">'+okMsg+'</span>');
				}
			}
		}).focus(function(){
			$(this).triggerHandler("blur");
		});
		$("#login_btn").click(function(){
			$("form :input").trigger("blur");
			var numError = $("form .onError").length;
			if(numError){
				return false;
			}
		});
	});
</script>
</head>

<body>
	<div class="container">
		<%@ include file="template/msg.file"  %>
        <div class="center">
        	<div class="box">
            	<div class="size1">
                	<h3 class="ico1">发表新文章</h3>
                	<form action="post!post.jspx" method="post">
                	<input  type="hidden" name="boardid" value="${id }"/>
                	<input type="hidden" name="userid" value="${sessionScope.user.id }"/>
                    <table>
                    	<tbody>
                        	<%@ include file="template/msg.file" %>
                            <tr>
                            	<th>标题</th>
                                <td>
                                	<input class="required" id="title" name="title" type="text"  />
                                </td>
                            </tr>
                            <tr class="mmpart">
                            	<th>内容：</th>
                                <td>
                                	<textarea id="content"  name="content" style="width:400px;height:300px;" >
                                	
                                	</textarea>
                                </td>                            
                            </tr>
                            <tr>
                            	<th>&nbsp;</th>
                                <td>
                                    <input type="submit" id="login_btn" value="发表文章"  class="btnstyle"/>
                                </td>
                                </tr>
                        </tbody>
                    </table>
                    </form>
                </div>
            </div>
              </div>
        <%@include file="template/footer.jsp"%>
    </div>
</body>
</html>

